/*
 * author      : 吴中勤
 * date        : 2018/8/24
 * description : TODO
 */

package com.deepexi.adapter.config;

import com.deepexi.adapter.sdk.moby.MobySdk;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MobySdkConfig {

    private static final Logger logger = LoggerFactory.getLogger(MobySdkConfig.class);

    @Value("${moby.sdk.profile}")
    private String mobySdkProfile;

    @Value("${moby.sdk.host.product-center}")
    private String mobyProductCenter;

    @Value("${moby.sdk.host.car-center}")
    private String mobyCarCenter;
//    moby.sdk.host.car-center=http://193.112.4.11:8001/car-deepexi-car-center
//    moby.sdk.host.product-center=http://193.112.4.11:8001/car-deepexi-car-center

    @Bean
    public MobySdk mobySdk() {
        MobySdk mobySdk = new MobySdk(mobySdkProfile);
        mobySdk.setConfigMobyHost(mobyCarCenter, mobyProductCenter);
        return mobySdk;
    }

}
